import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({

    routes: [{
        path: '/login',
        name: 'login',
        redirect: '/login/sign',
        component: () => import('@/views/login/index.vue'),
        children: [
            //登录
            {
                path: 'sign',
                name: 'sign',
                meta: {
                    title: '登录',
                },
                component: () => import('@/views/login/signIn.vue')
            },
            {
                path: 'setPassword',
                name: 'setPassword',
                meta: {
                    title: '设置密码'
                },
                component: () => import("@/views/login/setPassword.vue"),
            },
            {
                path: 'organizaRegistr',
                name: 'organizaRegistr',
                meta: {
                    title: '注册'
                },
                component: () => import("@/views/login/organizaRegistr.vue"),
            },
            {
                path: 'retrieve',
                name: 'retrieve',
                meta: {
                    title: '找回密码'
                },
                component: () => import("@/views/login/retrieve.vue"),
            },
            {
                path: 'binding',
                name: 'binding',
                meta: {
                    title: '绑定'
                },
                component: () => import("@/views/login/binding.vue"),
            },
            {
                path: 'agree',
                name: 'agree',
                meta: {
                    title: '用户协议'
                },
                component: () => import("@/views/login/agree.vue"),
            },
            {
                path: 'agreeYinsi',
                name: 'agreeYinsi',
                meta: {
                    title: '用户隐私'
                },
                component: () => import("@/views/login/agreeYinsi.vue"),
            },
        ]}, {
            path: '/',
            meta: { title: '数字图书馆' },
            redirect: '/commonfooter/index',
            component: () =>
                import ('@/views/index'),
        }, {
            path: '/home',
            name: 'home',
            meta: { title: '图书' },
            component: () =>
                import ('@/views/resource/home'),
        }, {
            path: '/bookDet',
            name: 'bookDet',
            meta: { title: '图书详情' },
            component: () =>
                import ('@/views/course/bookDet'),
        }, {
            path: '/videoDet',
            name: 'videoDet',
            meta: { title: '视频详情' },
            component: () =>
                import ('@/views/course/videoDet'),
        }, {
            path: '/audioDet',
            name: 'audioDet',
            meta: { title: '音频详情' },
            component: () =>
                import ('@/views/course/audioDet'),
        },  {
            path: '/search',
            name: 'search',
            meta: { title: '搜索' },
            component: () =>
                import ('@/views/resource/search'),
        }, {
            path: '/resource',
            name: 'resource',
            meta: { title: '资源列表' },
            component: () =>
                import ('@/views/resource/index'),
        }, {
            path: '/filter',
            name: 'filterindex',
            meta: { title: '筛选' },
            component: () =>
                import ('@/views/resource/filterIndex'),
        }, {
            path: '/member',
            name: 'member',
            meta: { title: '会员' },
            component: () =>
                import ('@/views/myperson/member'),
        }, {
            path: '/myorder',
            name: 'myorder',
            meta: { title: '我的订单' },
            component: () =>
                import ('@/views/myperson/myorder'),
        }, {
            path: '/orderDet',
            name: 'orderDet',
            meta: { title: '订单详情' },
            component: () =>
                import ('@/views/myperson/orderDet'),
        }, {
            path: '/message',
            name: 'message',
            meta: { title: '系统通知' },
            component: () =>
                import ('@/views/message/index'),
        }, {
            path: '/messageDetails',
            name: 'messageDetails',
            meta: { title: '消息详情' },
            component: () =>
                import ('@/views/message/details'),
        }, {
            path: '/addReview',
            name: 'addReview',
            meta: { title: '添加评论' },
            component: () =>
                import ('@/views/review/addReveiw'),
        }, {
            path: '/comments',
            name: 'comments',
            meta: { title: '全部评论' },
            component: () =>
                import ('@/views/review/comments'),
        }, {
            path: '/mycollect',
            name: 'mycollect',
            meta: { title: '我的收藏' },
            component: () =>
                import ('@/views/myperson/mycollect'),
        }, {
            path: '/specialList',
            name: 'specialList',
            meta: { title: '专题详情' },
            component: () =>
                import ('@/views/special/specialList'),
        }, {
            path: '/edit',
            name: 'edit',
            meta: { title: '个人信息' },
            component: () =>
                import ('@/views/myperson/edit'),
        }, {
            path: '/set',
            name: 'set',
            meta: { title: '我的设置' },
            component: () =>
                import ('@/views/myperson/set'),
        }, {
            path: '/introduction',
            name: 'introduction',
            meta: { title: '关于我们' },
            component: () =>
                import ('@/views/myperson/introduction'),
        }, {
            path: '/password',
            name: 'password',
            meta: { title: '修改密码' },
            component: () =>
                import ('@/views/myperson/password'),
        }, {
            path: '/verify',
            name: 'verify',
            meta: { title: '验证手机' },
            component: () =>
                import ('@/views/myperson/verify'),
        }, {
            path: '/bookList',
            name: 'bookList',
            meta: { title: '重磅推荐' },
            component: () =>
                import ('@/views/resource/bookList'),
        }, {
            path: '/record',
            name: 'record',
            meta: { title: '历史记录' },
            component: () =>
                import ('@/views/bookShelf/record'),
        },  {
            path: '/orderList',
            name: 'orderList',
            meta: { title: '确认订单' },
            component: () =>
                import ('@/views/resource/orderList'),
        }, {
            path: '/ebook',
            name: 'ebook',
            meta: { title: '电子书' },
            component: () =>
                import ('@/views/ebook/index')
        }, {
            path: '/catalog',
            name: 'catalog',
            meta: { title: '目录' },
            component: () =>
                import ('@/views/ebook/catalog')
        }, {
            path: '/commonfooter',
            name: 'commonfooter',
            component: () =>
                import ('@/components/tab'),
            redirect: '/commonfooter/index',
            children: [{
                    path: 'index',
                    name: 'index',
                    meta: { title: '华夏出版社' },
                    component: () =>
                        import ('@/views/index'),
                },
                {
                    path: 'special',
                    name: 'special',
                    meta: { title: '专题' },
                    component: () =>
                        import ('@/views/special/index'),
                },
                {
                    path: 'bookShelf',
                    name: 'bookShelf',
                    meta: { title: '书架' },
                    component: () =>
                        import ('@/views/bookShelf/index'),
                },
                {
                    path: 'my',
                    name: 'my',
                    meta: { title: '我的' },
                    component: () =>
                        import ('@/views/myperson/index'),
                },
            ]
        },
    ]
})
